<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    {load href="/static/js/layer/skin/default/layer.css" /}
    <style>
        tr,th{
            text-align: center;
        }
        th{
            color: #797979;
        }
        #keyword{
            width: 300px;
        }
        .breadcrumb{
            background-color: #515151;
        }
        .breadcrumb span{
            color: #ffffff;
        }
        .ml15{
            margin-left: 15px;
        }
        .c2{
            cursor: pointer;
            text-align: center;
            display: inline-block;
            width: 100px;
            height: 35px;
            line-height: 15px;
            margin-right: 10px;
        }
        .mytab{
            font-size:15px;
            border-bottom: 1px solid #C8C8C8;
            margin-bottom: 20px;
        }

        .mytab .active{
            border-bottom: 4px solid #505050;
            color: #ff5800;
        }
    </style>
</head>
<body>
<div style="padding-left: 20px;padding-right: 20px;">

    <ol class="breadcrumb">
        <li><span href="#">当前位置</span></li>
        <li><span href="#">系统设置</span></li>
        <li class="active"><span>会员信息</span></li>
    </ol>
    <div class="container-fluid">
        <div class="mytab">
            <span class="c2" onclick="window.location.href='{:url('Card/mycard')}'">会员卡列表</span>
            <span class="c2 active">会员信息</span>
            <span class="c2" onclick="window.location.href='{:url('Card/memberopereate')}'">会员运营</span>
            <span class="c2" onclick="window.location.href='{:url('Card/memberdata')}'">会员数据</span>
            <span class="c2" onclick="window.location.href='{:url('Card/addcard')}'">新建会员卡</span>
            <span class="c2" onclick="window.location.href='{:url('Card/wxconfig')}'">配置公众号</span>
        </div>
        <div class="container-fluid" style="margin-top: 20px;margin-bottom: 20px;">
            <div class="form-inline">
                <form action="#" method="get">
                <div class="form-group">
                    <input type="text" class="form-control" name="starttime" placeholder="注册开始日期" onclick="laydate()" readonly/>
                </div>
                <div class="form-group">
                    <input type="text" class="form-control" name="endtime" placeholder="注册截止日期" onclick="laydate()" readonly/>
                </div>
                会员信息
                <div class="form-group">
                    <input type="text" class="form-control" name="username" placeholder="会员电话/姓名"/>
                </div>
                <button class="btn btn-primary search" type="submit">搜索</button>
                <button class="btn btn-default">导出</button>
                </form>
            </div>
        </div>
        <table class="table table-bordered">
            <thead>
            <tr class="active">
                <th>注册日期</th><th>会员名称</th><th>会员电话</th><th>性别</th><th>会员来源</th><th>推广人员</th><th>会员卡数量</th><th>会员分组</th><th>总金额</th><th>总积分</th><th>操作</th>
            </tr>
            </thead>
            <tbody>
            	<?php foreach($members as $k=>$v):?>
            <tr><td><?php echo date("Y-m-d H:i:s",$v['createtime']);?></td><td><?php echo $v['username'];?></td><td><?php echo $v['usertel'];?></td>
            	<input type="hidden" name="id"  value="<?php echo $v['id']?>">
            	<?php if($v['sex']==false):?>
            	<td>保密</td>
            	<?php elseif($v['sex']==1):?>
            	            	<td>男</td>
<?php elseif($v['sex']==2):?>
	
	            	            	<td>女</td>
<?php endif;?>
	<?php if($v['from']==false):?>
            	<td>微信推广</td>
            	<?php endif;?>
            		    <td>wwwww</td>

            	<td><?php echo $v['usernum'];?></td>
            	
            	<?php if($v['usergroup']==false):?>
            	<td>默认分组</td>
            	<?php endif;?>

            	<td><?php echo $v['countmoney'];?>元</td>
            	<td><?php echo $v['countjifen'];?>分</td>
            	<td><button class="btn btn-info btn-sm edit" >编辑</button><button class="btn btn-info btn-sm ml15 p1">下架</button><button class="btn btn-info btn-sm ml15 p2">推广</button></td></tr>
<?php endforeach;?>           
            
            </tbody>
        </table>
    </div>
</div>


<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
{load href="/static/js/layer/layer.js,/static/js/laydate/laydate.js" /}
<script>
</script>
<script>



        $(".edit").on("click",function () {

            layer.open({
                type: 2,
                title: '添加管理员',
                shadeClose: true,
                shade: 0.8,
                area: ['1500px', '100%'],
                content: "{:url('index/card/memberedit')}?id="+$(this).parent().parent().find("[name='id']").val() //iframe的url
            });




        })

        $(".p1").on("click",function () {
            var io=$(this).parent().parent();
            var li = "{:url('index/card/memberedit')}?id=" + io.find("[name='id']").val();

            $.ajax({
                url:li,
                data:{
                    method:"1",





                },
                dataType:"json",
                type:"post",
                success:function (ret) {
                    layer.alert(ret.msg);
                 //   location.href=history.go(-1);
                setTimeout(function () {


                    io.fadeOut();



                })


                }





            })



        })






</script>

</body>
</html>